package com.md.api.common.config;

public enum RedisKeys {

    //极速 天气
    JISU_WEATHER_MD5("JISU:WEATHER:MD5:"),
    //极速 日历
    JISU_CALENDAR_DATE("JISU:CALENDAR:DATE:"),
    //短信：验证码
    SMS_CODE("SMS:CODE:"),
    //邮件：验证码
    EMAIL_CODE_ACCOUNT("EMAIL:CODE:ACCOUNT:"),
    //邮件：某个用户某日发送邮件次数
    EMAIL_SEND_COUNT_DATE_UID("EMAIL:SEND_COUNT:DATE:{0}:UID:{1}"),



    //用户基本信息
    USER_FIXED_INFO_TOKEN("USER:FIXED_INFO:TOKEN:"),
    SYSUSER_FIXED_INFO_TOKEN("SYSUSER:FIXED_INFO:TOKEN:"),

    //短信验证成功操作码
    OPEN_WEB_SMS_CODE_PHONE_SUCCESS("OPEN-WEB:SMS:CODE:PHONE:SUCCESS:"),
    //邮件验证信息缓存
    OPEN_WEB_EMAIL_CODE_ACCOUNT("OPEN-WEB:EMAIL:CODE:ACCOUNT:"),
    ;


    private String redisKey;

    RedisKeys(String redisKey) {
        this.redisKey = redisKey;
    }

    public String redisKey() {
        return this.redisKey;
    }



    public static String getUserTokenInfoKey(String token) {
        return USER_FIXED_INFO_TOKEN + token;
    }
    public static String getSysUserTokenInfoKey(String token) {
        return SYSUSER_FIXED_INFO_TOKEN + token;
    }

}
